using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Facebook.Api.DemoSite.Models;

namespace Facebook.Api.DemoSite.Controllers
{
    public class RedirectController : Controller
    {
        public RedirectController()
        {
            this.Redirects = new Dictionary<String, String>
            {
                { "codeplex-project", "http://facebook.codeplex.com" }
            };
        }

        public Dictionary<String, String> Redirects { get; set; }

        public ActionResult Index(String id)
        {
            if (this.Redirects.ContainsKey(id)) return new FbRedirectResult(this.Redirects[id]);
            else return new HttpNotFoundResult(String.Format("Could not find a redirect for {0}", id));
        }

    }
}
